package com.itheima.String;

public class Constructor {
   /* public static void main(String[] args) {
        String s1 = new String();
        System.out.println(s1);

        char[] chr = {'a','b','c'};
        String s2 = new String(chr);
        System.out.println(s2);

        String s3 = new String("123");
        System.out.println(s3);

        byte[] bys = {97,98,99};
        String s4 = new String (bys);
        System.out.println(s4);
    }
    */
   public static void main(String[] args) {
       String s1 = "abc";
       String s2 = "abc";
       System.out.println(s1 == s2);

       String s3 = "ab";
       String s4 = s3 + "c";
       System.out.println( s4 == s1);
       //常量优先机制
       String s5 = "a"+"b"+"c";
       System.out.println(s5 == s1);

   }
}
